<?php

use common\helpers\Html;
use common\helpers\Utils;
use common\assets\VideoPlayerAsset;

VideoPlayerAsset::register($this);
?>

<div class="video-container">
    <video controls x5-playsinline playsinline webkit-playsinline id="my-video" preload="auto" poster="<?= $video['cover'] ?>" data-setup="{}" class="video-js">
        <source src="<?= $video['url'] ?>" type="<?= $video['type'] ?>">
        <p class="vjs-no-js">
            To view this video please enable JavaScript, and consider upgrading to a web browser that
            <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
        </p>
    </video>
</div>
<div class="weui-panel" style="margin-top: 0;">
    <div class="weui-panel__hd"><i class="ionicons ion-ios-videocam-outline"></i> 视频来自于《<?= $model->catename ?>》</div>
    <div class="weui-panel__bd">
        <div class="weui-media-box weui-media-box_text">
            <h4 class="weui-media-box__title"><?= $model->title ?></h4>
            <p class="weui-media-box__desc"><?= $model->description ?></p>
            <ul class="weui-media-box__info">
                <li class="weui-media-box__info__meta">
                    <i class="ionicons ion-stats-bars"></i>
                    <?= Yii::$app->formatter->asDecimal($model->views) ?>
                </li>
                <li class="weui-media-box__info__meta">
                    <i class="ionicons ion-ios-clock-outline" aria-hidden="true"></i>
                    <?= date('M d H:i', $model->created_at) ?>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="marketing-state">
    <?php if (!empty($recommend)): ?>
        <div class="ms-goods">
            <a class="ms-goods-media" href="<?= \yii\helpers\Url::to($recommend['url']) ?>">
                <?= Html::img($recommend['cover'], [], true) ?>
            </a>
            <div class="ms-goods-cate">
                <span>热销推荐</span>
            </div>
            <h2 class="ms-goods-title"><?= $recommend['title'] ?></h2>
        </div>
        <hr class="hr-short">
    <?php endif; ?>
    <div class="ms-qrcode">
        <div class="ms-qrcode-tips">更多精彩 尽在<?= Yii::$app->params['title'] ?></div>
        <?= Html::img($qrcodeUrl, [], true) ?>
        <h3>长按二维码 <small>关注领取红包</small></h3>
    </div>
</div>